home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / Tools / Freeware / PerfectPaint / rexx / line / Pointer.rx < prev   
Encoding:
Text File  |  2002-10-28  |  2.4 KB  |  133 lines

  1. /*
  2. Pointer.rx by Saint
  3. (line Script)
  4. V1.0
  5. */
  6.  
  7.     call addlib("rexxmathlib.library", 5, -30, 0)
  8.  
  9.     options results
  10.   parse ARG Port x1 y1 x2 y2 b 
  11.     ADDRESS value Port
  12.         Pi=3.1415926
  13.     width=x2-x1
  14.     height=y2-y1
  15. winkel=20    
  16. l=sqrt(width**2 + height**2)
  17. l2=1.5*l /*Laenge der schraege*/
  18. /*winkel ausrechnen*/
  19. neunzig=trunc(rad(asin(height/l)),0)
  20. y=l2*sin(deg(neunzig-winkel)) /*sinus=y/l2*/
  21. x=l2*cos(deg(neunzig-winkel))
  22. if x1>x2 then x=-x
  23. kox1=x1+x
  24. koy1=y1+y
  25.  
  26. winkel=-20
  27. y=l2*sin(deg(neunzig-winkel)) /*sinus=y/l2*/
  28. x=l2*cos(deg(neunzig-winkel))
  29. if x1>x2 then x=-x
  30.  
  31. kox2=x1+x
  32. koy2=y1+y
  33. pp_StartPoly
  34. pp_AddPoly x1 y1
  35. pp_AddPoly kox1 koy1
  36. pp_AddPoly x2 y2
  37. pp_AddPoly kox2 koy2
  38. pp_AddPoly x1 y1
  39. pp_EndpolyF 
  40.  ==
  41.  == 
  42. /* Effect Operators Scroll*/
  43.     call addlib("rexxmathlib.library", 5, -30, 0)
  44.     options results
  45.  
  46.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  47. /*Opt1 Fade 1=Ja 0=Nein*/
  48. /*Opt2 Modus ein=0 aus=1*/
  49. /*Opt3 Richtung Oben=0 Unten=1 rechts=2 links=3*/
  50. /*t0 Nr=0 Anima=1*/
  51. /*t1 Nr=0 Anima=1*/
  52.     ADDRESS value Port
  53.       pp_GetWidth
  54.     w=result
  55.     x=w/2
  56.     pp_GetHeight
  57.     h=result
  58.     y=h/2
  59. pp_FindEmptyBrush
  60. Brush=result
  61.     if Brush=-1 then DO
  62.         pp_Warn "can't*find*empty|Brush."
  63.         EXIT        
  64.     END
  65. pp_SetBrush Brush
  66. pp_GotoFrame S1
  67. pp_PickBrush 0 0 w h 1
  68. pp_SpareOnOff
  69. pp_Plot w/2 h/2
  70. Frames=S1-S0
  71. ticks=h/Frames
  72. pp_SpareOnOff
  73. Select
  74.     When Opt3=0 then up()
  75.     When Opt3=1 then down()
  76.     When Opt3=2 then rechts()
  77.     when Opt3=3 then links()
  78.  
  79.     END
  80.     
  81.     
  82. exit
  83.  
  84. down:
  85. do i=1 to Frames-1
  86. pp_SpareonOff
  87. pp_PickBrush 0 0 w i*ticks 1
  88. pp_SpareOnOff
  89. pp_GotoFrame S0+i
  90. pp_Plot w/2 h-(i*ticks)/2
  91. end
  92. return 0
  93.  
  94. up:
  95. do i=1 to Frames-1
  96. pp_SpareonOff
  97. pp_PickBrush 0 h-i*ticks w i*ticks 1
  98. pp_SpareOnOff
  99. pp_GotoFrame S0+i
  100. pp_Plot w/2 (i*ticks)/2
  101. end
  102. return 0
  103.  
  104. links:
  105. do i=1 to Frames-1
  106. say i
  107. pp_SpareonOff
  108. pp_PickBrush w 0 w-ticks*i h 1
  109. pp_SpareOnOff
  110. pp_GotoFrame S0+i
  111. pp_Plot (i*ticks)/2  h/2
  112. end
  113. return 0
  114.  
  115. rechts:
  116. do i=1 to Frames-1
  117. pp_SpareonOff
  118. pp_PickBrush 0 0 (ticks*i) h 1
  119. pp_SpareOnOff
  120. pp_GotoFrame S0+i
  121. pp_Plot w-(i*ticks/2) h/2
  122. end
  123. return 0
  124.  ==
  125.  
  126. Regards
  127. -- 
  128. Markus Castro <Markus@Amigafuture.de>                               (Y)
  129.  ________       ____     _      __                                 (°-°)
  130. /_  __/ /  ___ / __/__ _(_)__  / /_   Amiga Aktuell Autor         ()-,-()--<{@
  131.  / / / _ \/ -_)\ \/ _ `/ / _ \/ __/                               (_)-(_)
  132. /_/ /_//_/\__/___/\_,_/_/_//_/\__/    AmigaFuture Autor
  133.